/*----------------------------------------------------------------------------
 * Image Roll Over
 * ---------------------------------------------------------------------------
 * Date      : 2011-07-04
 * Author    : naiyumie
 * ---------------------------------------------------------------------------
 * USAGE
 * ---------------------------------------------------------------------------
 * $(selector).LeftMenu();
 * ---------------------------------------------------------------------------
 * EXAMPLE
 * ---------------------------------------------------------------------------
 *
 *----------------------------------------------------------------------------
 */
$.fn.ImageRollOver	= function (option)
{
	option = option || {};

	var target	= option.target ? option.target : 'a';

	var getExt	= function (src)
	{
		var str_dotlocation = src.lastIndexOf(".");
		return src.substring(str_dotlocation);
	};

	$(this).find(target).children('img').each(function()
	{
		$(this).mouseover(function()
		{
			var ext	= getExt($(this).attr('src'));
			var src	= $(this).attr('src');
				src	= src.replace(ext, '_on' + ext);

			$(this).attr('src', src);
		});

		$(this).mouseout(function()
		{
			var ext	= getExt($(this).attr('src'));
			var src	= $(this).attr('src');
				src	= src.replace('_on' + ext, ext);

			$(this).attr('src', src);
		});
	});
};